package cn.changein.framework.modular.system.wrapper;

import cn.changein.framework.base.wrapper.BaseControllerWrapper;
import cn.changein.framework.core.constant.factory.ConstantFactory;
import cn.changein.framework.core.util.DecimalUtil;
import cn.changein.framework.kernel.model.page.PageResult;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;
import java.util.Map;

/**
 * 通知列表的包装

 * @date: 2020-02-18
 * @copyright: 广州澄境科技有限公司
 */
public class NoticeWrapper extends BaseControllerWrapper {

    public NoticeWrapper(Map<String, Object> single) {
        super(single);
    }

    public NoticeWrapper(List<Map<String, Object>> multi) {
        super(multi);
    }

    public NoticeWrapper(Page<Map<String, Object>> page) {
        super(page);
    }

    public NoticeWrapper(PageResult<Map<String, Object>> pageResult) {
        super(pageResult);
    }

    @Override
    protected void wrapTheMap(Map<String, Object> map) {
        Long creater = DecimalUtil.getLong(map.get("createUser"));
        map.put("createrName", ConstantFactory.me().getUserNameById(creater));
    }
}

